/**
 * Copyright &copy; 2012-2016 <a href="https://www.kaaction.com">KAA</a> All rights reserved All rights reserved.
 */
package com.kaaction.modules.eb.entity;

import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotNull;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.kaaction.common.persistence.DataEntity;

/**
 * 订单Entity
 * @author zengbiao
 * @version 2017-04-19
 */
public class Order extends DataEntity<Order> {
	
	private static final long serialVersionUID = 1L;
	private String orderCode;		// 订单流水号
	private Customer customer;		// 买家
	private OrderProduct orderProduct;
	private Product product;
	private Integer productQuantity;		// 商品数量
	private Double productTotalFee;		// 总价
	private String status;		// 状态
	private Double transportFee;		// 运费
	private Double customerPaidFee;		// 实际支付
	private String payChannel;		// 支付
	private String invoiceType;		// 发票类型
	private String invoiceName;		// 发票抬头
	private String invoiceContent;		// 发票内容
	private String tranportChannel;		// 运输方式
	private Date transportDate;		// 配送日期
	private String transportDateBrief;		// 配送日期概述
	private String recipientAddress;		// 收件人地址
	private String recipientName;		// 收件人姓名
	private String recipientContact;		// 收件人联系方式，如电话
	
	public Order() {
		super();
	}

	public Order(String id){
		super(id);
	}

	@Length(min=1, max=64, message="订单流水号长度必须介于 1 和 64 之间")
	public String getOrderCode() {
		return orderCode;
	}

	public void setOrderCode(String orderCode) {
		this.orderCode = orderCode;
	}
	
	@NotNull(message="买家不能为空")
	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}
	
	public Integer getProductQuantity() {
		return productQuantity;
	}

	public void setProductQuantity(Integer productQuantity) {
		this.productQuantity = productQuantity;
	}
	
	@NotNull(message="总价不能为空")
	public Double getProductTotalFee() {
		return productTotalFee;
	}

	public void setProductTotalFee(Double productTotalFee) {
		this.productTotalFee = productTotalFee;
	}
	
	public OrderProduct getOrderProduct() {
		return orderProduct;
	}

	public void setOrderProduct(OrderProduct orderProduct) {
		this.orderProduct = orderProduct;
	}

	@Length(min=0, max=3, message="状态长度必须介于 0 和 3 之间")
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	
	public Double getTransportFee() {
		return transportFee;
	}

	public void setTransportFee(Double transportFee) {
		this.transportFee = transportFee;
	}
	
	public Double getCustomerPaidFee() {
		return customerPaidFee;
	}

	public void setCustomerPaidFee(Double customerPaidFee) {
		this.customerPaidFee = customerPaidFee;
	}
	
	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	@Length(min=0, max=45, message="支付长度必须介于 0 和 45 之间")
	public String getPayChannel() {
		return payChannel;
	}

	public void setPayChannel(String payChannel) {
		this.payChannel = payChannel;
	}
	
	@Length(min=0, max=3, message="发票类型长度必须介于 0 和 3 之间")
	public String getInvoiceType() {
		return invoiceType;
	}

	public void setInvoiceType(String invoiceType) {
		this.invoiceType = invoiceType;
	}
	
	@Length(min=0, max=45, message="发票抬头长度必须介于 0 和 45 之间")
	public String getInvoiceName() {
		return invoiceName;
	}

	public void setInvoiceName(String invoiceName) {
		this.invoiceName = invoiceName;
	}
	
	@Length(min=0, max=45, message="发票内容长度必须介于 0 和 45 之间")
	public String getInvoiceContent() {
		return invoiceContent;
	}

	public void setInvoiceContent(String invoiceContent) {
		this.invoiceContent = invoiceContent;
	}
	
	@Length(min=0, max=45, message="运输方式长度必须介于 0 和 45 之间")
	public String getTranportChannel() {
		return tranportChannel;
	}

	public void setTranportChannel(String tranportChannel) {
		this.tranportChannel = tranportChannel;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getTransportDate() {
		return transportDate;
	}

	public void setTransportDate(Date transportDate) {
		this.transportDate = transportDate;
	}
	
	@Length(min=0, max=45, message="配送日期概述长度必须介于 0 和 45 之间")
	public String getTransportDateBrief() {
		return transportDateBrief;
	}

	public void setTransportDateBrief(String transportDateBrief) {
		this.transportDateBrief = transportDateBrief;
	}
	
	@Length(min=0, max=100, message="收件人地址长度必须介于 0 和 100 之间")
	public String getRecipientAddress() {
		return recipientAddress;
	}

	public void setRecipientAddress(String recipientAddress) {
		this.recipientAddress = recipientAddress;
	}
	
	@Length(min=0, max=45, message="收件人姓名长度必须介于 0 和 45 之间")
	public String getRecipientName() {
		return recipientName;
	}

	public void setRecipientName(String recipientName) {
		this.recipientName = recipientName;
	}
	
	@Length(min=0, max=45, message="收件人联系方式，如电话长度必须介于 0 和 45 之间")
	public String getRecipientContact() {
		return recipientContact;
	}

	public void setRecipientContact(String recipientContact) {
		this.recipientContact = recipientContact;
	}
	
}